laravel migration default value

110

mysql timestamp in laravel migration -

$table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));

laravel migration default value -

$table->increments('id');
            $table->string('name');
            $table->string('url');
            $table->string('country');
            $table->tinyInteger('status')->default('1');
            $table->timestamps();

laravel migration change default value -

Schema::table('users', function ($table) {
    $table->integer('active')->default(0)->change();
});

sequelize migration default value -

queryInterface.addColumn('OrderBackups', 'my_column', {
  type: Sequelize.INTEGER,
  defaultValue: 0
})

Comments

Submit
0 Comments